package com.jianan.mis.data.domain.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the os_department_contract table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="os_department_contract"
 */

public abstract class BaseOsDepartmentContract  implements Serializable {

	public static String REF = "OsDepartmentContract";
	public static String PROP_NAME = "Name";
	public static String PROP_LICENSE = "License";
	public static String PROP_SIGNUP_SUM = "SignupSum";
	public static String PROP_CONTRACT_NO = "ContractNo";
	public static String PROP_ID = "Id";
	public static String PROP_COUNTRY = "Country";
	public static String PROP_DEPARTMENT = "Department";
	public static String PROP_SIGNUP_DATE = "SignupDate";


	// constructors
	public BaseOsDepartmentContract () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseOsDepartmentContract (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseOsDepartmentContract (
		java.lang.Integer id,
		com.jianan.mis.data.domain.Department department,
		java.lang.String name,
		java.util.Date signupDate,
		java.math.BigDecimal signupSum,
		java.lang.String contractNo,
		boolean license) {

		this.setId(id);
		this.setDepartment(department);
		this.setName(name);
		this.setSignupDate(signupDate);
		this.setSignupSum(signupSum);
		this.setContractNo(contractNo);
		this.setLicense(license);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String name;
	private java.util.Date signupDate;
	private java.math.BigDecimal signupSum;
	private java.lang.String contractNo;
	private boolean license;

	// many to one
	private com.jianan.mis.data.domain.Department department;
	private com.jianan.mis.data.domain.Country country;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: name
	 */
	public java.lang.String getName () {
		return name;
	}

	/**
	 * Set the value related to the column: name
	 * @param name the name value
	 */
	public void setName (java.lang.String name) {
		this.name = name;
	}



	/**
	 * Return the value associated with the column: signup_date
	 */
	public java.util.Date getSignupDate () {
		return signupDate;
	}

	/**
	 * Set the value related to the column: signup_date
	 * @param signupDate the signup_date value
	 */
	public void setSignupDate (java.util.Date signupDate) {
		this.signupDate = signupDate;
	}



	/**
	 * Return the value associated with the column: signup_sum
	 */
	public java.math.BigDecimal getSignupSum () {
		return signupSum;
	}

	/**
	 * Set the value related to the column: signup_sum
	 * @param signupSum the signup_sum value
	 */
	public void setSignupSum (java.math.BigDecimal signupSum) {
		this.signupSum = signupSum;
	}



	/**
	 * Return the value associated with the column: contract_no
	 */
	public java.lang.String getContractNo () {
		return contractNo;
	}

	/**
	 * Set the value related to the column: contract_no
	 * @param contractNo the contract_no value
	 */
	public void setContractNo (java.lang.String contractNo) {
		this.contractNo = contractNo;
	}



	/**
	 * Return the value associated with the column: license
	 */
	public boolean isLicense () {
		return license;
	}

	/**
	 * Set the value related to the column: license
	 * @param license the license value
	 */
	public void setLicense (boolean license) {
		this.license = license;
	}



	/**
	 * Return the value associated with the column: department_id
	 */
	public com.jianan.mis.data.domain.Department getDepartment () {
		return department;
	}

	/**
	 * Set the value related to the column: department_id
	 * @param department the department_id value
	 */
	public void setDepartment (com.jianan.mis.data.domain.Department department) {
		this.department = department;
	}



	/**
	 * Return the value associated with the column: country_id
	 */
	public com.jianan.mis.data.domain.Country getCountry () {
		return country;
	}

	/**
	 * Set the value related to the column: country_id
	 * @param country the country_id value
	 */
	public void setCountry (com.jianan.mis.data.domain.Country country) {
		this.country = country;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.jianan.mis.data.domain.OsDepartmentContract)) return false;
		else {
			com.jianan.mis.data.domain.OsDepartmentContract osDepartmentContract = (com.jianan.mis.data.domain.OsDepartmentContract) obj;
			if (null == this.getId() || null == osDepartmentContract.getId()) return false;
			else return (this.getId().equals(osDepartmentContract.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}